/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.synjones.zeus.model.ykt.cardinfo;

import com.synjones.core.util.AmtHelper;
import com.synjones.core.util.StringUtil;

import java.math.BigDecimal;

/**
 * @author liubinqiang
 * @version V1.0
 * @date 2017-5-23 15:27:15
 * @desc 卡信息
 */
public class CardInfoBean {

    /**
     * 一卡通帐号
     */
    private String account;
    /**
     * 用户姓名
     */
    private String name;
    /**
     * 未领取余额，分为单位
     */
    private String unsettle_amount;
    private String unsettle_amount_;
    /**
     * 库余额，分为单位
     */
    private String db_balance;
    private String db_balance_;
    /**
     * 卡状态，0是正常，安徽大学1是预开卡状态
     */
    private String acc_status;
    /**
     * 挂失标识 0:正常 1:挂失
     */
    private String lostflag;
    /**
     * 冻结标识 0:正常 1:冻结
     */
    private String freezeflag;
    /**
     * 身份标识 0:无身份信息 1:有身份信息
     */
    private String idflag;
    /**
     * 扫码业务开通标识 0:未开通 1:开通
     */
    private String barflag;
    /**
     * 开户时间
     */
    private String createdate;
    private String createdate_;
    /**
     * 过期时间
     */
    private String expdate;
    private String expdate_;
    /**
     * 卡类型
     */
    private String cardtype;
    /**
     * 卡类型名
     */
    private String cardname;
    /**
     * 绑定银行卡号
     */
    private String bankacc;
    /**
     * 学号
     */
    private String sno;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 证件类型 001:身份证
     */
    private String certtype;
    /**
     * 证件号
     */
    private String cert;
    /**
     * 自动转账警戒额，分为单位
     */
    private String autotrans_limite;

    private String autotrans_limite_;
    /**
     * 自动转账额，分为单位
     */
    private String autotrans_amt;
    private String autotrans_amt_;
    /**
     * 转账标识
     */
    private String autotrans_flag;
    /**
     * 主副卡标识 0、 非主副卡 1、 主卡 2、 副卡
     */
    private String mscard;
    /**
     * 副卡数量
     */
    private String scard_num;

    /**
     * 判断卡状态是否正常
     *
     * @return
     */
    public boolean isAccStatusOk() {
        return "0".equals(acc_status);
    }

    public String getAcc_status() {
        return acc_status;
    }

    public void setAcc_status(String acc_status) {
        this.acc_status = acc_status;
    }

    /**
     * @return the autotrans_amt_
     */
    public String getAutotrans_amt_() {
        return autotrans_amt_;
    }

    /**
     * @param autotrans_amt_ the autotrans_amt_ to set
     */
    public void setAutotrans_amt_(String autotrans_amt_) {
        this.autotrans_amt_ = autotrans_amt_;
    }

    /**
     * @return the autotrans_limite_
     */
    public String getAutotrans_limite_() {
        return autotrans_limite_;
    }

    /**
     * @param autotrans_limite_ the autotrans_limite_ to set
     */
    public void setAutotrans_limite_(String autotrans_limite_) {
        this.autotrans_limite_ = autotrans_limite_;
    }

    /**
     * @return the createdate_
     */
    public String getCreatedate_() {
        return createdate_;
    }

    /**
     * @param createdate_ the createdate_ to set
     */
    public void setCreatedate_(String createdate_) {
        this.createdate_ = createdate_;
    }

    /**
     * @return the db_balance_
     */
    public String getDb_balance_() {
        if (!StringUtil.isNullOrEmpty(this.db_balance_)) {
            BigDecimal amt = new BigDecimal(this.db_balance_);
            return String.valueOf(amt.setScale(2, BigDecimal.ROUND_DOWN));
        }
        return db_balance_;
    }

    /**
     * @param db_balance_ the db_balance_ to set
     */
    public void setDb_balance_(String db_balance_) {
        this.db_balance_ = db_balance_;
    }

    /**
     * @return the expdate_
     */
    public String getExpdate_() {
        return expdate_;
    }

    /**
     * @param expdate_ the expdate_ to set
     */
    public void setExpdate_(String expdate_) {
        this.expdate_ = expdate_;
    }

    /**
     * @return the unsettle_amount_
     */
    public String getUnsettle_amount_() {
        if (!StringUtil.isNullOrEmpty(this.unsettle_amount_)) {
            BigDecimal amt = new BigDecimal(this.unsettle_amount_);
            return String.valueOf(amt.setScale(2, BigDecimal.ROUND_DOWN));
        }
        return unsettle_amount_;
    }

    /**
     * @param unsettle_amount_ the unsettle_amount_ to set
     */
    public void setUnsettle_amount_(String unsettle_amount_) {
        this.unsettle_amount_ = unsettle_amount_;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUnsettle_amount() {
        return unsettle_amount;
    }

    public void setUnsettle_amount(String unsettle_amount) {
        this.unsettle_amount = unsettle_amount;
    }

    public String getDb_balance() {
        return db_balance;
    }

    public void setDb_balance(String db_balance) {
        this.db_balance = db_balance;
    }

    /**
     * 是否已经挂失
     *
     * @return
     */
    public boolean isLost() {
        return "1".equals(lostflag);
    }

    public String getLostflag() {
        return lostflag;
    }

    public void setLostflag(String lostflag) {
        this.lostflag = lostflag;
    }

    /**
     * 是否已经冻结
     *
     * @return
     */
    public boolean isFreeze() {
        return "1".equals(freezeflag);
    }

    public String getFreezeflag() {
        return freezeflag;
    }

    public void setFreezeflag(String freezeflag) {
        this.freezeflag = freezeflag;
    }

    public String getIdflag() {
        return idflag;
    }

    public void setIdflag(String idflag) {
        this.idflag = idflag;
    }

    public String getBarflag() {
        return barflag;
    }

    public void setBarflag(String barflag) {
        this.barflag = barflag;
    }

    public String getCreatedate() {
        return createdate;
    }

    public void setCreatedate(String createdate) {
        this.createdate = createdate;
    }

    public String getExpdate() {
        return expdate;
    }

    public void setExpdate(String expdate) {
        this.expdate = expdate;
    }

    public String getCardtype() {
        return cardtype;
    }

    public void setCardtype(String cardtype) {
        this.cardtype = cardtype;
    }

    public String getCardname() {
        return cardname;
    }

    public void setCardname(String cardname) {
        this.cardname = cardname;
    }

    public String getBankacc() {
        return bankacc;
    }

    public void setBankacc(String bankacc) {
        this.bankacc = bankacc;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCerttype() {
        return certtype;
    }

    public void setCerttype(String certtype) {
        this.certtype = certtype;
    }

    public String getCert() {
        return cert;
    }

    public void setCert(String cert) {
        this.cert = cert;
    }

    public String getAutotrans_limite() {
        return autotrans_limite;
    }

    public void setAutotrans_limite(String autotrans_limite) {
        this.autotrans_limite = autotrans_limite;
    }

    public String getAutotrans_amt() {
        return autotrans_amt;
    }

    public void setAutotrans_amt(String autotrans_amt) {
        this.autotrans_amt = autotrans_amt;
    }

    public String getAutotrans_flag() {
        return autotrans_flag;
    }

    public void setAutotrans_flag(String autotrans_flag) {
        this.autotrans_flag = autotrans_flag;
    }

    public String getMscard() {
        return mscard;
    }

    public void setMscard(String mscard) {
        this.mscard = mscard;
    }

    public String getScard_num() {
        return scard_num;
    }

    public void setScard_num(String scard_num) {
        this.scard_num = scard_num;
    }

}
